<?php

use admin\components\BaseGridView;
use app\models\UserAr;
use yii\helpers\Html;

/* @var $dataProvider */

?>

<div class="mb-2">
    <?= Html::a(Yii::t('app', 'Add New Users'), ['save'], ['class' => 'btn']); ?>
</div>

<?= BaseGridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => NULL,
    'columns' => [
        'id',
        ['attribute' => 'gid', 'format' => 'raw', 'value' => function (UserAr $model) {
            return $model->getGroupName();
        }],
        'username',
        'nickname',
        'last_login_time:datetime',
        ['attribute' => 'status', 'format' => 'raw', 'value' => function (UserAr $model) {
            return $model->getStatusName();
        }],
        [
            'class' => 'admin\components\BaseActionColumn',
            'template' => '{save}',
        ]
    ],
]); ?>
